package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
)

func main() {
	r := gin.Default()
	//第一个参数：分组的path
	user := r.Group("/user")
	user.POST("/register", registerHandle)
	user.GET("/login", loginHandle)
	user.DELETE("/:id", deleteHandle)
	r.Run(":8010")
}
func registerHandle(context *gin.Context) {
	path := "用户注册" + context.FullPath()
	fmt.Println(path)
	context.Writer.WriteString(path)
}
func loginHandle(context *gin.Context) {
	path := "用户登录" + context.FullPath()
	fmt.Println(path)
	context.Writer.WriteString(path)
}
func deleteHandle(context *gin.Context) {
	path := "删除登录" + context.FullPath()
	UserID := context.Param("id")
	fmt.Println(path)
	context.Writer.WriteString(path + UserID)
}
